<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="<c:url value='/css/style.css'/>" rel="stylesheet" type="text/css"/>
<fmt:setBundle basename="messages" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="JavaScript" src="scripts/ts_picker.js"></script>
<title><fmt:message key="title"/></title>
</head>
<body>
<div style="height: 119px; margin-left: 1px">
        <h1 style="text-align: center">
            Leave Application</h1><div id="sidebar1" style="width: 199px; height: 266px">
	<h2>Menu</h2>
	
	<p><a href="LeaveApplyJSP.jsp">Apply Leave</a></p>
	<p style="width: 202px; "><a href="PersonalLeaveHistory.jsp">View Personal Leave History</a></p>
	<p><a href="PersonalLeaveUpdate.jsp">Edit Leave(s)</a></p>
	
	<p><a href="LogoutServlet.jsp">Logout</a></p>
  	<!-- end #sidebar1 --></div>
        </div>
        <div style="margin-left: 248px; height: 379px; width: 496px;"><div>

		<fmt:message key="label.employee"/>
        <c:url var="url" scope="page" value="/EmployeeEntryPage.jsp">        		
                <c:param name="employeeid" value=""/>
                <c:param name="firstname" value=""/>
                <c:param name="surname" value=""/>
                <c:param name="designation" value=""/> 
                <c:param name="role" value=""/> 
                <c:param name="phone" value=""/> 
                <c:param name="address" value=""/> 
                <c:param name="email" value=""/> 
                <c:param name="password" value=""/> 
                <c:param name="mname" value=""/> 
                <c:param name="gender" value=""/>
                <c:param name="nric" value=""/>                  
                <c:param name="insert" value="true"/>
        </c:url>
        <a href="${url}"><fmt:message key="label.employee.add"/></a>
        <br/><br/>
        <table class="borderAll">
            <tr>
            	<th><fmt:message key="label.employee.employeeid"/></th>
                <th><fmt:message key="label.employee.firstname"/></th>
                <th><fmt:message key="label.employee.surname"/></th>                
                <th><fmt:message key="label.employee.designation"/></th>
                <th><fmt:message key="label.employee.role"/></th>
                <th><fmt:message key="label.employee.phone"/></th>
                <th><fmt:message key="label.employee.address"/></th>
                <th><fmt:message key="label.employee.email"/></th>
                <th><fmt:message key="label.employee.password"/></th>
                <th><fmt:message key="label.employee.mname"/></th>
                <th><fmt:message key="label.employee.gender"/></th>
                <th><fmt:message key="label.employee.nric"/></th>
                <th><fmt:message key="label.employee.edit"/> <fmt:message key="label.employee.delete"/></th>
            </tr>
            <c:forEach var="employee" items="${employees}" varStatus="idx">
                <tr>
                    <td class="nowrap">${idx.index+1 }</td>                    
                    <td class="nowrap">${employee.firstName}</td>                    
                    <td class="nowrap">${employee.surName}</td>
                    <td class="nowrap">${employee.designation}</td>
                    <td class="nowrap">${employee.role}</td>
                    <td class="nowrap">${employee.telNumber}</td>
                    <td class="nowrap">${employee.address}</td>
                    <td class="nowrap">${employee.email}</td>
                    <td class="nowrap">${employee.password}</td>
                    <td class="nowrap">${employee.managerID}</td>
                    <td class="nowrap">${employee.gender}</td>
                    <td class="nowrap">${employee.nric}</td>
                    <td class="nowrap">
                        <c:url var="updurl" scope="page" value="/EmployeeEntryPage.jsp">                            
                            <c:param name="firstname" value="${employee.firstName}"/>
			                <c:param name="surname" value="${employee.surName}"/>
			                <c:param name="designation" value="${employee.designation}"/> 
			                <c:param name="role" value="${employee.role}"/> 
			                <c:param name="phone" value="${employee.telNumber}"/> 
			                <c:param name="address" value="${employee.address}"/> 
			                <c:param name="email" value="${employee.address}"/> 
			                <c:param name="password" value="${employee.password}"/> 
			                <c:param name="mname" value="${employee.managerID}"/> 
			                <c:param name="gender" value="${employee.gender}"/>
			                <c:param name="nric" value="${employee.nric}"/>                                 
                             <c:param name="update" value="true"/>
                        </c:url>
                        <a href="${updurl}"><fmt:message key="label.employee.edit"/></a>
                        &nbsp;&nbsp;&nbsp;
                        <c:url var="delurl" scope="page" value="/employee delete">
                            <c:param name="firstname" value="${employee.firstName}"/>                            
                        </c:url>
                        <a href="${delurl}"><fmt:message key="label.employee.delete"/></a>
                    </td>
                </tr>
            </c:forEach>
        </table></div></div>
</body>
</html>